package top.continew.admin.controller.distribute;

import cn.shengchao.examstar.rpc.base.PageResult;
import cn.shengchao.examstar.rpc.distribute.bi.DistributeNodeBI;
import cn.shengchao.examstar.rpc.distribute.enums.DistributeSaleRoleEnum;
import cn.shengchao.examstar.rpc.distribute.enums.DistributeTypeEnum;
import cn.shengchao.examstar.rpc.distribute.req.DistributeNodeInfoQueryPage;
import cn.shengchao.examstar.rpc.distribute.resp.DistributeNodeInfoRespEntity;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: examstar-manger-api
 * @description: 市场经理管理的Rest api
 * @author: Xiong weiqiang
 * @create: 2025-03-26 17:04
 */
@Tag(name = "分销-市场经理")
@RestController
@RequestMapping("/distribute/marketManager")
public class DistributeMarketManagerController {
    @DubboReference
    DistributeNodeBI distributeNodeBIService;

    /**
     * 分页查询分销市场经理列表
     * @param pageQuery
     * @return
     */
    @Operation(summary = "市场经理列表", description = "市场经理列表")
    @GetMapping("/pageQuery")
    PageResult<DistributeNodeInfoRespEntity> pageQuery(DistributeNodeInfoQueryPage pageQuery) {
        pageQuery.setDistributeRoleCode(DistributeSaleRoleEnum.ROLE_MKMG.getCode());
        pageQuery.setDistributeType(DistributeTypeEnum.TYPE_SALE.getType());
        return distributeNodeBIService.queryDistributeNodeInfoPageResult(pageQuery);
    }


}